﻿<%@ Page Title="供应商库" Language="C#" MasterPageFile="~/masterPage/admin/Purchase.master" AutoEventWireup="true" CodeFile="PurchRetrieval.aspx.cs" Inherits="Trade_Resource_vendor_retrieval" %>

<%@ MasterType VirtualPath="~/masterPage/admin/Purchase.master" %>  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1">
    </telerik:RadAjaxLoadingPanel>    
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rtsMenuBar">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rtsMenuBar"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
    
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
    <table>
        <tr>
            <td colspan="2">
    <telerik:RadTabStrip ID="rtsMenuBar" runat="server" SelectedIndex="2" 
                    ontabclick="rtsMenuBar_TabClick">
        <Tabs>
            <telerik:RadTab Text="按产品类别检索" Value="Part" PageViewID="RadPageView1"></telerik:RadTab>
            <telerik:RadTab Text="按工艺类别检索" Value="Process" PageViewID="RadPageView1"></telerik:RadTab>
            <telerik:RadTab Text="我的供应商库" Value="MyVendors" Selected="True" PageViewID="RadPageView1"></telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
            </td>
        </tr>
    </table>
   <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
                <telerik:RadPageView ID="RadPageView1" runat="server">
    <table>        
        <tr>
            <td valign="top">
                <telerik:RadDockZone ID="rdzVednorFolders" runat="server"  Height="300px" Width="250px" Visible="false">
                    <telerik:RadDock ID="rdVendorFolders" runat="server" Width="250px" DefaultCommands="None" Title="我的供应商库" CloseText="关闭" CollapseText="收起" DockMode="Docked" ExpandText="展开"  EnableRoundedCorners="true" Collapsed="false" Resizable="false" Pinned="true" EnableDrag="false">
                        <ContentTemplate>
                            <telerik:RadTreeView ID="rtvMyVendors" runat="server" AllowNodeEditing="true" 
                                EnableDragAndDrop="false" onnodeclick="rtvMyVendors_NodeClick">
                                <ContextMenus>
                                    <telerik:RadTreeViewContextMenu ID="ChildContextMenu" runat="server">
                                        <Items>
                                            <telerik:RadMenuItem Value="Delete" Text="删除" ImageUrl="~/App_Themes/Default/img/icon/delete16.gif">
                                            </telerik:RadMenuItem>
                                        </Items>
                                        <CollapseAnimation Type="none" />
                                    </telerik:RadTreeViewContextMenu>
                                    <telerik:RadTreeViewContextMenu ID="RootContextMenu" runat="server">
                                        <Items>
                                            <telerik:RadMenuItem Value="NewFolder" Text="新建库" ImageUrl="~/App_Themes/Default/img/icon/newfolder16.gif">
                                            </telerik:RadMenuItem>
                                        </Items>
                                        <CollapseAnimation Type="none" />
                                    </telerik:RadTreeViewContextMenu>
                                </ContextMenus>
                                <Nodes>
                                    <telerik:RadTreeNode Value="00000000-0000-0000-0000-000000000000" ContextMenuID="RootContextMenu" AllowEdit="false" Font-Bold="true" Text="我的供应商库 (1)" Expanded="true" ImageUrl="~/App_Themes/Default/img/icon/folder16.gif">

                                    </telerik:RadTreeNode>
                                </Nodes>

                            </telerik:RadTreeView>
                        
                        </ContentTemplate>
                    </telerik:RadDock>
                </telerik:RadDockZone>
                <telerik:RadDockZone ID="rdzNavigator" runat="server" Height="600px" Width="250px">
                    <telerik:RadDock ID="rdSearchKey" runat="server" Height="100px" DefaultCommands="ExpandCollapse" BorderStyle="None" CloseText="关闭" CollapseText="收起" ExpandText="展开" DockHandle="None" Collapsed="false" Resizable="false" Pinned="true" EnableDrag="false">
                        <ContentTemplate>
                        <table>
                            <tr>
                                <td>
                                &nbsp;
                                </td>
                                <td>
                                   
                                </td>
                            </tr>
                            <tr>
                                <td>
                                关键词：
                                </td>
                                <td>
                                    <asp:TextBox ID="tbKeyword" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                资质证明：
                                </td>
                                <td>
                                   
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button ID="btnSearch" runat="server" Text="立即检索" 
                                        onclick="btnSearch_Click" />
                                </td>
                                <td>
                                    <asp:Button ID="btnClear" runat="server" Text="重新设定" onclick="btnClear_Click"  />
                                </td>
                            </tr>
                        </table>
                        </ContentTemplate>
                    </telerik:RadDock>
                    <telerik:RadDock ID="rdWCCatalog" runat="server" Height="200px" DefaultCommands="ExpandCollapse" Title="通用/标准零部件类型" CloseText="关闭" CollapseText="收起" DockMode="Docked" ExpandText="展开"  EnableRoundedCorners="true" Collapsed="false" Resizable="false" Pinned="true" EnableDrag="false">
                        <ContentTemplate>
                             <telerik:RadTreeView ID="rtvWCCatalog" runat="server" Width="100%" 
                                 DataSourceID="xdsWareCubes" DataTextField="title" DataValueField="key" AllowNodeEditing="false" CausesValidation="false" CheckBoxes="true"  EnableDragAndDrop="false">
                                <DataBindings>
                                    <telerik:RadTreeNodeBinding Expanded="false" ExpandMode="ServerSideCallBack" CheckableField="check"  />
                                </DataBindings>
                            </telerik:RadTreeView>
                        </ContentTemplate>
                    </telerik:RadDock>
                    <telerik:RadDock ID="rdLocation" runat="server" Height="200px" DefaultCommands="ExpandCollapse" Title="您的位置" CloseText="关闭" CollapseText="收起" DockMode="Docked" ExpandText="展开"  EnableRoundedCorners="true" Collapsed="false" Resizable="false" Pinned="true" EnableDrag="false">
                    <ContentTemplate>
                        <telerik:RadTreeView ID="rtvLocation" runat="server"  CheckBoxes="true" 
                            AllowNodeEditing="false" onnodeexpand="rtvLocation_NodeExpand">
                        </telerik:RadTreeView>
                    </ContentTemplate>
                    </telerik:RadDock>

                </telerik:RadDockZone>
            </td>
            
            <td valign="top" width="700">
                <telerik:RadDockZone ID="rdzVendors" runat="server">

                    <telerik:RadDock ID="rdCmdBarForVendorList" runat="server" Width="700px" DefaultCommands="None" DockHandle="None" DockMode="Docked"  Resizable="false" EnableDrag="false">
                    <ContentTemplate>
                                    <asp:LinkButton ID="lbtBackup" runat="server" CommandName="SetBackup" 
                                        ForeColor="Blue" Font-Underline="true" Text="添加到供应商库" 
                                        onclick="lbtBackup_Click" />&nbsp;&nbsp;
                                    <asp:LinkButton ID="lbtPublish" runat="server" CommandName="NewXP" 
                                        ForeColor="Blue" Font-Underline="true" Text="发布询盘" onclick="lbtPublish_Click" />&nbsp;&nbsp;
                                    <asp:LinkButton ID="lbtRemove" runat="server" Visible="false" 
                                        CommandName="Remove" ForeColor="Blue" Font-Underline="true" Text="移除" 
                                        onclick="lbtRemove_Click" />&nbsp;&nbsp;
                                    <telerik:RadComboBox ID="rcbVendorFolders" runat="server" AllowCustomText="false">
                                    </telerik:RadComboBox>
                                    
                                    <br />
                    </ContentTemplate>
                    </telerik:RadDock>
                    
                    <telerik:RadDock ID="rdVendorList" runat="server" Width="700px" DefaultCommands="None" Title="供应商列表" CloseText="关闭" CollapseText="收起" DockMode="Docked" ExpandText="展开"  EnableRoundedCorners="true" Collapsed="false" Resizable="false" Pinned="true" EnableDrag="false">
                        <ContentTemplate>

                                    
                        <telerik:RadGrid ID="radGridVendorlist" AllowPaging="True" AllowSorting="True" DataSourceID="sdsVendorList"
                        runat="server" AutoGenerateColumns="False" AllowMultiRowSelection="True" 
                                PageSize="5" onitemcommand="radGridVendorlist_ItemCommand">
                            <PagerStyle AlwaysVisible="true" FirstPageToolTip="首页" ShowPagerText="false" PagerTextFormat="{4}  当前{0}/{1}页, 条目({2}-{3})/{5}" NextPagesToolTip="下页" Mode="NextPrevAndNumeric" PageSizeLabelText="单页数目" PrevPageToolTip="上页" LastPageToolTip="末页" />
                            <HierarchySettings ExpandTooltip="查看报价单详细信息" CollapseTooltip="收起" />
                            <MasterTableView DataKeyNames="CompanyID, CompanyName" ShowHeadersWhenNoRecords="true" NoMasterRecordsText="没有可用的供应商" AllowMultiColumnSorting="false">

                                <Columns>
                                    <telerik:GridClientSelectColumn Reorderable="False" Groupable="false" UniqueName="ClientSelectColumn">
                                        <HeaderStyle Width="30px"></HeaderStyle>
                                    </telerik:GridClientSelectColumn>
                                    <telerik:GridImageColumn ImageWidth="120" AllowSorting="false" AllowFiltering="false" DataAlternateTextField="CompanyAliasName" Groupable="false" UniqueName="Logo" Resizable="false" DataImageUrlFields="Logo" >
                                    </telerik:GridImageColumn>
                                    <telerik:GridTemplateColumn>
                                    <HeaderTemplate>
                                    
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <table border="1">
                                            <tr>
                                                <td>
                                                    <asp:Literal ID="ltlCompanyName" Text='<%# DataBinder.Eval(Container.DataItem, "CompanyName") %>' runat="server"></asp:Literal>
                                                </td>
                                                <td>
                                                
                                                </td>
                                                <td>
                                                
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                公司描述：<asp:Literal ID="ltlDescription" Text='<%# DataBinder.Eval(Container.DataItem, "Description") %>' runat="server"></asp:Literal>
                                                </td>
                                                <td>
                                                电话：
                                                <asp:Literal ID="ltlOfficePhone" Text='<%# DataBinder.Eval(Container.DataItem, "OfficePhone") %>' runat="server"></asp:Literal>

                                                </td>
                                                <td>
                                                联系人：
                                                <asp:Literal ID="Literal1" Text='<%# DataBinder.Eval(Container.DataItem, "FamilyName") %>' runat="server"></asp:Literal>
                                                <asp:Literal ID="Literal2" Text='<%# DataBinder.Eval(Container.DataItem, "FirstName") %>' runat="server"></asp:Literal>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                业务范围：
                                                </td>
                                                <td>
                                                <asp:Literal ID="ltlBiz" Text='<%# DataBinder.Eval(Container.DataItem, "Technology") %>' runat="server"></asp:Literal>

                                                </td>
                                                <td>
                                                
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                国家城市：
                                                </td>
                                                <td>
                                                <asp:Literal ID="ltlCountry" Text='<%# DataBinder.Eval(Container.DataItem, "Country") %>' runat="server"></asp:Literal> / 
                                                <asp:Literal ID="ltlProvince" Text='<%# DataBinder.Eval(Container.DataItem, "Province") %>' runat="server"></asp:Literal>
                                                </td>
                                                <td>
                                                
                                                </td>
                                            </tr>
                                        </table>
                                    </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridHyperLinkColumn AllowFiltering="false" Text="零部件模型库" Target="blank" Groupable="false" DataNavigateUrlFields="CompanyID" DataNavigateUrlFormatString="~/part.aspx?v={0}">
                                    </telerik:GridHyperLinkColumn>
                                    <telerik:GridHyperLinkColumn AllowFiltering="false" Text="站内邮件" Target="blank" Groupable="false" DataNavigateUrlFields="CompanyID" DataNavigateUrlFormatString="~/Trade/Inbox/MailBoxList.aspx?v={0}">
                                    </telerik:GridHyperLinkColumn>
                                </Columns>
                                </MasterTableView>
                                <ClientSettings>
                                    <Selecting AllowRowSelect="true" EnableDragToSelectRows="false" UseClientSelectColumnOnly="true" />
                                </ClientSettings>
                                
                            </telerik:RadGrid> 
                        
                        </ContentTemplate>                    
                    </telerik:RadDock>
                
                </telerik:RadDockZone>
            
            </td>
        </tr>
    
    </table>
    </telerik:RadPageView>
    </telerik:RadMultiPage>

    </telerik:RadDockLayout>

    <asp:XmlDataSource ID="xdsWareCubes" runat="server" 
        DataFile="~/App_Data/XML/warecube.xml"></asp:XmlDataSource>
    <asp:XmlDataSource ID="xdsProcess" runat="server" 
        DataFile="~/App_Data/XML/MfgProcess.xml"></asp:XmlDataSource>
        
    <asp:SqlDataSource ID="sdsVendorList" runat="server" 
        ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>" 
        SelectCommand="SELECT * FROM [vw_XPCompany_Supply] WHERE [VendorModerateStatus] =1"
         FilterExpression="{0}" >
        <FilterParameters>
            <asp:Parameter Name="Filter1" Type="String" />
        </FilterParameters>
        </asp:SqlDataSource>    
    <asp:SqlDataSource ID="sdsMyVendorList" runat="server" 
        ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>" 
        SelectCommand="SELECT * FROM [vw_XPFavoriteVendors] WHERE ([OwnerCompanyID] = @OwnerCompanyID)">
        <SelectParameters>
            <asp:Parameter Name="OwnerCompanyID" DbType="Guid" />
        </SelectParameters>
    </asp:SqlDataSource>    
    
</asp:Content>

